Micron Document
<!DOCTYPE html>
<html class="client-nojs vector-feature-language-in-header-enabled vector-feature-language-in-main-page-header-disabled vector-feature-page-tools-pinned-disabled vector-feature-toc-pinned-clientpref-0 vector-toc-not-available vector-feature-main-menu-pinned-disabled vector-feature-limited-width-clientpref-1 vector-feature-limited-width-content-enabled vector-feature-custom-font-size-clientpref-1 vector-feature-appearance-pinned-clientpref-0 vector-feature-night-mode-enabled skin-theme-clientpref-os vector-sticky-header-enabled" lang="fr" dir="ltr"><head>
<meta charset="UTF-8">
<title>Shell Unix</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="icon" type="image/png" href="./_res_/favicon.png">
<link rel="canonical" href="https://fr.wikipedia.org/wiki/Shell_Unix"> <link href="./_mw_/ext.cite.styles.css" rel="stylesheet" type="text/css">
<link href="./_mw_/ext.pygments.css" rel="stylesheet" type="text/css">
<link href="./_mw_/ext.wikimediamessages.styles.css" rel="stylesheet" type="text/css">
<link href="./_mw_/skins.vector.icons.css" rel="stylesheet" type="text/css">
<link href="./_mw_/skins.vector.search.codex.styles.css" rel="stylesheet" type="text/css">
<link href="./_mw_/skins.vector.styles.css" rel="stylesheet" type="text/css">
<meta name="ResourceLoaderDynamicStyles" content="">
<link rel="stylesheet" type="text/css" href="./_mw_/site.styles.css">
<link rel="stylesheet" type="text/css" href="./_mw_/noscript.css">
<link rel="stylesheet" type="text/css" href="./_res_/footer.css">
<link rel="stylesheet" type="text/css" href="./_res_/vector-2022.css">
</head>
<body class="skin--responsive skin-vector skin-vector-search-vue mediawiki ltr sitedir-ltr mw-hide-empty-elt ns-0 ns-subject page-Shell_Unix rootpage-Shell_Unix skin-vector-2022 action-view">
<div class="mw-page-container">
<div class="mw-page-container-inner">
<div class="mw-content-container">
<main id="content" class="mw-body">
<header class="mw-body-header vector-page-titlebar">
<h1 id="firstHeading" class="firstHeading mw-first-heading"><span class="mw-page-title-main">Shell Unix</span></h1>
</header>
<a id="top"></a>
<div id="bodyContent" class="vector-body ve-init-mw-desktopArticleTarget-targetContainer" aria-labelledby="firstHeading" data-mw-ve-target-container="">
<div id="contentSub">
<div id="mw-content-subtitle"></div>
</div>
<div id="mw-content-text" class="mw-body-content mw-content-ltr" lang="fr" dir="ltr"><div class="mw-content-ltr mw-parser-output" lang="fr" dir="ltr">
<p>Un <b>shell Unix</b> est un <a href="Interpr%C3%A9teur_de_commandes" title="Interpréteur de commandes">interpréteur de commandes</a> destiné aux <a href="Syst%C3%A8mes_d'exploitation" class="mw-redirect" title="Systèmes d'exploitation">systèmes d'exploitation</a> <a href="Unix" title="Unix">Unix</a> et de <a href="Type_Unix" title="Type Unix">type Unix</a> qui permet d'accéder aux fonctionnalités internes du système d'exploitation. C'est l'<a href="Interface_utilisateur" title="Interface utilisateur">interface utilisateur</a> du système d'exploitation, il permet entre autres de se déplacer dans l'<a href="Filesystem_Hierarchy_Standard" title="Filesystem Hierarchy Standard">arborescence du système</a>, créer, éditer ou supprimer des <a href="R%C3%A9pertoire_(informatique)" title="Répertoire (informatique)">répertoires</a> et des <a href="Fichier_informatique" title="Fichier informatique">fichiers</a>. Il se présente sous la forme d'une <a href="Interface_en_ligne_de_commande" title="Interface en ligne de commande">interface en ligne de commande</a> accessible depuis la <a href="Console_syst%C3%A8me" title="Console système">console</a> ou un <a href="Terminal_informatique" class="mw-redirect" title="Terminal informatique">terminal</a>. L'utilisateur lance des commandes sous forme d'une entrée texte exécutée ensuite par le shell. Les commandes sont des fichiers exécutables, située dans certains répertoires du système. Le shell est donc un <a href="Programme_informatique" title="Programme informatique">programme</a> qui peut exécuter ces commandes&nbsp;; il se trouve dans le répertoire <code>/bin</code>.
</p><p>Les systèmes d'exploitation de type <a href="Unix" title="Unix">Unix</a> disposent le plus souvent d'un shell. Il existe une trentaine de shell différents. À l'origine, l'interpréteur de commandes <a href="Valeur_par_d%C3%A9faut" title="Valeur par défaut">par défaut</a> était <a href="Bourne_shell" title="Bourne shell">sh</a>. Aujourd'hui <a href="Bourne-Again_shell" title="Bourne-Again shell">bash</a> est le shell le plus répandu.
</p>

<div class="mw-heading mw-heading2"><h2 id="Historique_des_shells_Unix">Historique des shells Unix</h2></div>

<p>Le premier shell est le Thompson shell&nbsp;<a href="https://en.wikipedia.org/wiki/Thompson_shell" class="extiw external" title="en:Thompson shell"><span class="indicateur-langue" title="Article en anglais&nbsp;: «&nbsp;Thompson shell&nbsp;»">(en)</span></a> apparu en 1971 avec la première version d’<a href="Unix" title="Unix">Unix</a> et écrit par <a href="Ken_Thompson" title="Ken Thompson">Ken Thompson</a>, l'un des créateurs d'<a href="Unix" title="Unix">Unix</a>. Il est remplacé par le <a href="Bourne_shell" title="Bourne shell">Bourne shell</a>, écrit par <a href="Stephen_Bourne" title="Stephen Bourne">Stephen Bourne</a>, en 1977 pour la version 7 d'<a href="Unix" title="Unix">Unix</a>.
</p><p>En 1978, <a href="Bill_Joy" title="Bill Joy">Bill Joy</a>, alors étudiant à l'<a href="Universit%C3%A9_de_Californie_%C3%A0_Berkeley" title="Université de Californie à Berkeley">Université de Californie à Berkeley</a>, crée <a href="Csh" class="mw-redirect" title="Csh">csh</a> (C shell), une évolution du shell dont la syntaxe s'inspire de celle du langage C. Il permet notamment la réutilisation de l'historique des commandes. Une version plus moderne du <a href="Csh" class="mw-redirect" title="Csh">csh</a> est ensuite publiée sous le nom <a href="Tcsh" title="Tcsh">tcsh</a>.
</p><p>Le <a href="Korn_shell" title="Korn shell">Korn shell</a> (ksh) est publié en 1983 par <a href="David_Korn" title="David Korn">David Korn</a>. Il est compatible avec le <a href="Bourne_shell" title="Bourne shell">Bourne shell</a>, reprend certaines fonctionnalités de <a href="Csh" class="mw-redirect" title="Csh">csh</a> et ajoute des fonctions de scripts avancées disponibles dans des langages plus évolués tels que le <a href="Perl_(langage)" title="Perl (langage)">Perl</a>.
</p><p>Le <a href="Bourne-Again_shell" title="Bourne-Again shell">Bourne-Again shell</a> (bash) apparait quant à lui en 1988. Il est écrit par Brian Fox pour la <a href="Free_Software_Foundation" title="Free Software Foundation">Free Software Foundation</a> dans le cadre du projet <a href="GNU" title="GNU">GNU</a>. C'est le shell de nombreuses implémentations libres d'<a href="Unix" title="Unix">Unix</a>, telles que les systèmes <a href="Linux" title="Linux">GNU/Linux</a>. Il est compatible avec le <a href="Bourne_shell" title="Bourne shell">Bourne shell</a> dont il se veut une implémentation libre.
</p><p>Paul Falstad crée <a href="Zsh" class="mw-redirect" title="Zsh">zsh</a> en 1990 alors qu'il est étudiant à l'<a href="Universit%C3%A9_de_Princeton" title="Université de Princeton">université de Princeton</a>. Ce shell reprend les fonctions les plus pratiques de <a href="Bourne-Again_shell" title="Bourne-Again shell">bash</a>, <a href="Csh" class="mw-redirect" title="Csh">csh</a>, <a href="Tcsh" title="Tcsh">tcsh</a>.
</p>
<div class="mw-heading mw-heading2"><h2 id="Shells">Shells</h2></div>
<p>À l'origine, l'interpréteur de commandes <a href="Valeur_par_d%C3%A9faut" title="Valeur par défaut">par défaut</a> était <a href="Bourne_shell" title="Bourne shell">sh</a>, qui donna naissance à de nombreuses variantes, dont <a href="Csh" class="mw-redirect" title="Csh">csh</a>, étendu en <a href="Tcsh" title="Tcsh">tcsh</a>, ou <a href="Korn_shell" title="Korn shell">ksh</a>, ou encore rc. Aujourd'hui <a href="Bourne-Again_shell" title="Bourne-Again shell">bash</a>, s'inspirant de <a href="Bourne_shell" title="Bourne shell">sh</a>, <a href="Korn_shell" title="Korn shell">ksh</a>, et <a href="Csh" class="mw-redirect" title="Csh">csh</a>, est le shell le plus répandu, bien qu'il existe d'autres interpréteurs de commandes, comme <a href="Zsh" class="mw-redirect" title="Zsh">zsh</a>, ou <a href="Almquist_shell" title="Almquist shell">ash</a>.
</p>
<ul><li>Shell de <a href="Stephen_Bourne" title="Stephen Bourne">Stephen Bourne</a>
<ul><li><a href="Bourne_shell" title="Bourne shell">Bourne shell</a> (sh)</li>
<li><a href="Bourne-Again_shell" title="Bourne-Again shell">Bourne-Again shell</a> (bash)</li></ul></li>
<li><a href="Csh" class="mw-redirect" title="Csh">csh</a>&nbsp;: C shell
<ul><li><a href="Tcsh" title="Tcsh">tcsh</a> (Tenex C shell, version moderne du csh)</li></ul></li>
<li>Shell de <a href="David_Korn" title="David Korn">David Korn</a>&nbsp;: <a href="Korn_shell" title="Korn shell">Korn shell</a> (ksh)</li>
<li>Shell de Kenneth Almquist, utilisé lorsqu'il est nécessaire d'avoir un shell prenant peu de place sur le disque, clone de la variante SVR4 du Bourne shell;
<ul><li><a href="Ash_shell" class="mw-redirect" title="Ash shell">Ash</a> (Almquist SHell)</li>
<li><a href="Debian_Almquist_shell" title="Debian Almquist shell">Dash shell</a> (<a href="Debian" title="Debian">Debian</a> Almquist Shell)</li></ul></li>
<li><a href="Z_Shell" title="Z Shell">Zsh</a> (zsh), reprenant les fonctions les plus pratiques de bash, ksh et tcsh.</li>
<li><a href="Friendly_Interactive_Shell" title="Friendly Interactive Shell">fish</a></li></ul>
<div class="mw-heading mw-heading2"><h2 id="Utilisation">Utilisation</h2></div>
<p>Le shell est un <a href="Programme_informatique" title="Programme informatique">programme</a>, exécutable en mode <a href="Terminal_(informatique)" title="Terminal (informatique)">terminal</a>, qui se trouve dans le répertoire <code>/bin</code><sup id="cite_ref-:0_1-0" class="reference"><a href="#cite_note-:0-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup>, et qui permet à l'utilisateur d’interagir avec le système en utilisant des <a href="Commandes_Unix" title="Commandes Unix">commandes</a>. L'utilisateur tape une <a href="Commandes_Unix" title="Commandes Unix">commande</a>, et le shell va interpréter cette commande et l'exécuter<sup id="cite_ref-2" class="reference"><a href="#cite_note-2"><span class="cite-bracket">[</span>2<span class="cite-bracket">]</span></a></sup>. Une commande est un <a href="Fichier_ex%C3%A9cutable" title="Fichier exécutable">fichier exécutable</a>, se trouvant dans certains répertoires du système<sup id="cite_ref-:0_1-1" class="reference"><a href="#cite_note-:0-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup>. La localisation du répertoire de chaque commande dépend du type de <a href="Distribution_Linux" title="Distribution Linux">distribution Linux</a>. Il est possible d'utiliser la commande <code>whereis</code> pour connaitre cette localisation<sup id="cite_ref-3" class="reference"><a href="#cite_note-3"><span class="cite-bracket">[</span>3<span class="cite-bracket">]</span></a></sup>.
</p>
<div class="mw-heading mw-heading3"><h3 id="Exemple">Exemple</h3></div>
<p>Une session avec l'interpréteur <a href="Tcsh" title="Tcsh">tcsh </a>:
</p>
<div class="mw-highlight mw-highlight-lang-bash mw-content-ltr" dir="ltr"><pre><span></span><span class="o">[</span>ske:~<span class="o">]</span><span class="w"> </span>ske%<span class="w"> </span><span class="nb">cd</span><span class="w"> </span>/usr/
<span class="w"> </span><span class="o">[</span>ske:/usr<span class="o">]</span><span class="w"> </span>ske%<span class="w"> </span>ls
<span class="w"> </span>bin<span class="w"> </span>lib<span class="w"> </span><span class="nb">local</span><span class="w"> </span>share
<span class="w"> </span>include<span class="w"> </span>libexec<span class="w"> </span>sbin<span class="w"> </span>standalone
<span class="w"> </span><span class="o">[</span>ske:/usr<span class="o">]</span><span class="w"> </span>ske%<span class="w"> </span>top
<span class="w"> </span><span class="o">[</span>ske:/usr<span class="o">]</span><span class="w"> </span>ske%<span class="w"> </span><span class="nb">cd</span><span class="w"> </span>/tmp
<span class="w"> </span><span class="o">[</span>ske:/tmp<span class="o">]</span><span class="w"> </span>ske%<span class="w"> </span>ls<span class="w"> </span>-l
<span class="w"> </span>total<span class="w"> </span><span class="m">152</span>
<span class="w"> </span>-rw-r--r--<span class="w"> </span><span class="m">1</span><span class="w"> </span>ske<span class="w"> </span>admin<span class="w"> </span><span class="m">68328</span><span class="w"> </span><span class="m">15</span><span class="w"> </span>Apr<span class="w"> </span><span class="m">10</span>:54<span class="w"> </span>93633C68062E855100FCE70A
<span class="w"> </span>-rw-r--r--<span class="w"> </span><span class="m">1</span><span class="w"> </span>ske<span class="w"> </span>admin<span class="w"> </span><span class="m">0</span><span class="w"> </span><span class="m">19</span><span class="w"> </span>Apr<span class="w"> </span><span class="m">09</span>:28<span class="w"> </span>cs_cache_lock_501
<span class="w"> </span>-rw-r--r--<span class="w"> </span><span class="m">1</span><span class="w"> </span>root<span class="w"> </span>admin<span class="w"> </span><span class="m">644</span><span class="w"> </span><span class="m">23</span><span class="w"> </span>Apr<span class="w"> </span><span class="m">09</span>:05<span class="w"> </span>mcx_compositor
<span class="w"> </span>drwxr-xr-x<span class="w"> </span><span class="m">3</span><span class="w"> </span>ske<span class="w"> </span>admin<span class="w"> </span><span class="m">102</span><span class="w"> </span><span class="m">19</span><span class="w"> </span>Apr<span class="w"> </span><span class="m">11</span>:39<span class="w"> </span>pb-man
<span class="w"> </span>-rw-r--r--<span class="w"> </span><span class="m">1</span><span class="w"> </span>ske<span class="w"> </span>admin<span class="w"> </span><span class="m">74</span><span class="w"> </span><span class="m">15</span><span class="w"> </span>Apr<span class="w"> </span><span class="m">10</span>:54<span class="w"> </span>reload-stub.s
<span class="w"> </span>srwxrw-rw-<span class="w"> </span><span class="m">1</span><span class="w"> </span>root<span class="w"> </span>admin<span class="w"> </span><span class="m">0</span><span class="w"> </span><span class="m">23</span><span class="w"> </span>Apr<span class="w"> </span><span class="m">09</span>:04<span class="w"> </span>slp_ipc
<span class="w"> </span><span class="o">[</span>ske:/tmp<span class="o">]</span><span class="w"> </span>ske%<span class="w"> </span><span class="nb">echo</span><span class="w"> </span>Hello<span class="w"> </span>World<span class="w"> </span>&gt;test.tmp
<span class="w"> </span><span class="o">[</span>ske:/tmp<span class="o">]</span><span class="w"> </span>ske%<span class="w"> </span>cat<span class="w"> </span>test.tmp<span class="w"> </span>
<span class="w"> </span>Hello<span class="w"> </span>World
<span class="w"> </span><span class="o">[</span>ske:/tmp<span class="o">]</span><span class="w"> </span>ske%<span class="w"> </span>rm<span class="w"> </span>test.tmp<span class="w"> </span>
<span class="w"> </span><span class="o">[</span>ske:/tmp<span class="o">]</span><span class="w"> </span>ske%
</pre></div><p>Si on regarde la première ligne de cet exemple&nbsp;:
</p><p><code>[ske:~] ske% cd /usr/</code>
</p><p>Entre crochets, <code>[ske:~]</code> nous indique que l'on se trouve dans le <a href="R%C3%A9pertoire_personnel" title="Répertoire personnel">répertoire (dossier) <i>home</i></a> de l'utilisateur. C'est ce que signifie le signe <a href="Tilde" title="Tilde">tilde</a><sup id="cite_ref-4" class="reference"><a href="#cite_note-4"><span class="cite-bracket">[</span>4<span class="cite-bracket">]</span></a></sup>. Ensuite, <code>ske%</code> est le signal d'invit (prompt), en attente d'une commande. La première commande tapée est ici <code><a href="Cd_(commande)" title="Cd (commande)">cd</a></code>, qui permet de changer de répertoire. Elle est suivie du nom de répertoire <code>/usr/</code>.
</p><p>Sur la deuxième ligne, on voit que l'on s'est effectivement déplacé&nbsp;: on se trouve maintenant dans le répertoire usr, comme l'indique le début de la ligne&nbsp;: <code>[ske:/usr]</code>. On utilise la commande <code><a href="Ls" title="Ls">ls</a></code>, qui permet d'afficher les sous-répertoires et <a href="Fichier_informatique" title="Fichier informatique">fichiers</a> présents dans le répertoire courant. Ceux ci s'affichent alors sur la <a href="Flux_standard" title="Flux standard">sortie standard</a>, c'est-à-dire notre terminal, on voit qu'il s'agit ici de bin, lib, local, share, include, libexec, sbin et standalone.
</p>
<div class="mw-heading mw-heading3"><h3 id="Gestion_des_entrées/sorties_et_redirection"><span id="Gestion_des_entr.C3.A9es.2Fsorties_et_redirection"></span>Gestion des entrées/sorties et redirection</h3></div>
<p>Les shells permettent de réaliser des redirections. Une redirection consiste à rediriger l'entrée ou la sortie d'une commande vers une autre commande ou un fichier.
</p>
<div class="mw-heading mw-heading4"><h4 id="Redirection_droite_simple">Redirection droite simple</h4></div>
<p>Syntaxe&nbsp;:
</p>
<div class="mw-highlight mw-highlight-lang-bash mw-content-ltr" dir="ltr"><pre><span></span><span class="w"> </span>commande<span class="w"> </span>&gt;<span class="w"> </span>fichier
</pre></div>
<p>Le résultat de l'invocation de la commande <code>commande</code> sera écrit dans le fichier <code>fichier</code>, en écrasant le précédent contenu.
</p><p>Exemple&nbsp;:
</p>
<div class="mw-highlight mw-highlight-lang-bash mw-content-ltr" dir="ltr"><pre><span></span>$:<span class="w"> </span>cat<span class="w"> </span>file
Welcome
$:<span class="w"> </span><span class="nb">echo</span><span class="w"> </span><span class="s2">"Hello world"</span><span class="w"> </span>&gt;<span class="w"> </span>file
$:<span class="w"> </span>cat<span class="w"> </span>file
Hello<span class="w"> </span>world
</pre></div>
<div class="mw-heading mw-heading4"><h4 id="Redirection_droite_double">Redirection droite double</h4></div>
<p>Syntaxe&nbsp;:
</p>
<div class="mw-highlight mw-highlight-lang-bash mw-content-ltr" dir="ltr"><pre><span></span><span class="w"> </span>commande<span class="w"> </span>&gt;&gt;<span class="w"> </span>fichier
</pre></div>
<p>Le résultat de l'invocation de la commande <code>commande</code> sera écrit dans le fichier <code>fichier</code>, à la suite des données déjà présentes.
</p><p>Exemple&nbsp;:
</p>
<div class="mw-highlight mw-highlight-lang-bash mw-content-ltr" dir="ltr"><pre><span></span>$:<span class="w"> </span>cat<span class="w"> </span>file
Welcome
$:<span class="w"> </span><span class="nb">echo</span><span class="w"> </span><span class="s2">"Hello world"</span><span class="w"> </span>&gt;&gt;<span class="w"> </span>file
$:<span class="w"> </span>cat<span class="w"> </span>file
Welcome
Hello<span class="w"> </span>world
</pre></div>
<div class="mw-heading mw-heading4"><h4 id="Redirection_gauche_simple">Redirection gauche simple</h4></div>
<p>Syntaxe&nbsp;:
</p>
<div class="mw-highlight mw-highlight-lang-bash mw-content-ltr" dir="ltr"><pre><span></span><span class="w"> </span>commande<span class="w"> </span>&lt;<span class="w"> </span>fichier
</pre></div>
<p>La commande <code>commande</code> va lire le contenu du fichier <code>fichier</code> au lieu de lire sur l'entrée standard (clavier).
</p><p>Exemple&nbsp;:
</p>
<div class="mw-highlight mw-highlight-lang-bash mw-content-ltr" dir="ltr"><pre><span></span>$:<span class="w"> </span>cat<span class="w"> </span>&lt;<span class="w"> </span>file
Welcome
</pre></div>
<div class="mw-heading mw-heading4"><h4 id="Redirection_gauche_double">Redirection gauche double</h4></div>
<p>Syntaxe&nbsp;:
</p>
<div class="mw-highlight mw-highlight-lang-bash mw-content-ltr" dir="ltr"><pre><span></span><span class="w"> </span>commande<span class="w"> </span>&lt;&lt;<span class="w"> </span>END
</pre></div>
<p>La commande <code>commande</code> va lire sur l'entrée standard jusqu'à ce que le mot suivant la double redirection soit rencontré.
</p><p>Exemple&nbsp;:
</p>
<div class="mw-highlight mw-highlight-lang-bash mw-content-ltr" dir="ltr"><pre><span></span>$:<span class="w"> </span>cat<span class="w"> </span><span class="s">&lt;&lt; TOTO</span>
<span class="s">? foo</span>
<span class="s">? bar</span>
<span class="s">? moomoo</span>
<span class="s">? TOTO</span>
foo
bar
moomoo
</pre></div>
<div class="mw-heading mw-heading3"><h3 id="Pipe">Pipe</h3></div>
<p>Syntaxe&nbsp;:
</p>
<div class="mw-highlight mw-highlight-lang-bash mw-content-ltr" dir="ltr"><pre><span></span><span class="w"> </span>commande_1<span class="w"> </span><span class="p">|</span><span class="w"> </span>commande_2
</pre></div>
<p>Le résultat de la commande <code>commande_1</code> va être redirigé dans l'entrée de la seconde commande <code>commande_2</code>.
</p><p>Exemple&nbsp;:
</p>
<div class="mw-highlight mw-highlight-lang-bash mw-content-ltr" dir="ltr"><pre><span></span>$:<span class="w"> </span><span class="nb">echo</span><span class="w"> </span><span class="s2">"Hello world"</span><span class="w"> </span><span class="p">|</span><span class="w"> </span>grep<span class="w"> </span>-o<span class="w"> </span><span class="s2">"Hello"</span>
Hello
</pre></div>
<div class="mw-heading mw-heading2"><h2 id="Fichier_de_configuration">Fichier de configuration</h2></div>
<table class="wikitable floatleft" style="text-align: center; margin-right: 2em;">

<tbody><tr>
<td>
</td>
<th>sh
</th>
<th>ksh
</th>
<th>csh
</th>
<th>tcsh
</th>
<th>bash
</th>
<th>zsh
</th></tr>
<tr>
<td style="text-align:left;"><tt>/etc/.login</tt>
</td>
<td>
</td>
<td>
</td>
<td>login
</td>
<td>login
</td>
<td>
</td>
<td>
</td></tr>
<tr>
<td style="text-align:left;"><tt>/etc/csh.cshrc</tt>
</td>
<td>
</td>
<td>
</td>
<td>yes
</td>
<td>yes
</td>
<td>
</td>
<td>
</td></tr>
<tr>
<td style="text-align:left;"><tt>/etc/csh.login</tt>
</td>
<td>
</td>
<td>
</td>
<td>login
</td>
<td>login
</td>
<td>
</td>
<td>
</td></tr>
<tr>
<td style="text-align:left;"><tt>~/.tcshrc</tt>
</td>
<td>
</td>
<td>
</td>
<td>
</td>
<td>yes
</td>
<td>
</td>
<td>
</td></tr>
<tr>
<td style="text-align:left;"><tt>~/.cshrc</tt>
</td>
<td>
</td>
<td>
</td>
<td>yes
</td>
<td>yes<sup id="cite_ref-5" class="reference"><a href="#cite_note-5"><span class="cite-bracket">[</span>note 1<span class="cite-bracket">]</span></a></sup>
</td>
<td>
</td>
<td>
</td></tr>
<tr>
<td style="text-align:left;"><tt>~/etc/ksh.kshrc</tt>
</td>
<td>
</td>
<td>int.
</td>
<td>
</td>
<td>
</td>
<td>
</td>
<td>
</td></tr>
<tr>
<td style="text-align:left;"><tt>/etc/sh.shrc</tt>
</td>
<td>int.<sup id="cite_ref-6" class="reference"><a href="#cite_note-6"><span class="cite-bracket">[</span>note 2<span class="cite-bracket">]</span></a></sup>
</td>
<td>
</td>
<td>
</td>
<td>
</td>
<td>
</td>
<td>
</td></tr>
<tr>
<td style="text-align:left;"><tt>$ENV (typically ~/.kshrc)</tt><sup id="cite_ref-7" class="reference"><a href="#cite_note-7"><span class="cite-bracket">[</span>5<span class="cite-bracket">]</span></a></sup>
</td>
<td>int.<sup id="cite_ref-9" class="reference"><a href="#cite_note-9"><span class="cite-bracket">[</span>note 3<span class="cite-bracket">]</span></a></sup><sup id="cite_ref-10" class="reference"><a href="#cite_note-10"><span class="cite-bracket">[</span>note 4<span class="cite-bracket">]</span></a></sup>
</td>
<td>int.
</td>
<td>
</td>
<td>
</td>
<td>int.<sup id="cite_ref-12" class="reference"><a href="#cite_note-12"><span class="cite-bracket">[</span>note 5<span class="cite-bracket">]</span></a></sup>
</td>
<td>
</td></tr>
<tr>
<td style="text-align:left;"><tt>~/.login</tt>
</td>
<td>
</td>
<td>
</td>
<td>login
</td>
<td>login
</td>
<td>
</td>
<td>
</td></tr>
<tr>
<td style="text-align:left;"><tt>~/.logout</tt>
</td>
<td>
</td>
<td>
</td>
<td>login
</td>
<td>login
</td>
<td>
</td>
<td>
</td></tr>
<tr>
<td style="text-align:left;"><tt>/etc/profile</tt>
</td>
<td>login
</td>
<td>login
</td>
<td>
</td>
<td>
</td>
<td>login
</td>
<td>login<sup id="cite_ref-zsh_profiles_13-0" class="reference"><a href="#cite_note-zsh_profiles-13"><span class="cite-bracket">[</span>note 6<span class="cite-bracket">]</span></a></sup>
</td></tr>
<tr>
<td style="text-align:left;"><tt>~/.profile</tt>
</td>
<td>login
</td>
<td>login
</td>
<td>
</td>
<td>
</td>
<td>login<sup id="cite_ref-bash_profiles_14-0" class="reference"><a href="#cite_note-bash_profiles-14"><span class="cite-bracket">[</span>note 7<span class="cite-bracket">]</span></a></sup>
</td>
<td>login<sup id="cite_ref-zsh_profiles_13-1" class="reference"><a href="#cite_note-zsh_profiles-13"><span class="cite-bracket">[</span>note 6<span class="cite-bracket">]</span></a></sup>
</td></tr>
<tr>
<td style="text-align:left;"><tt>~/.bash_profile</tt>
</td>
<td>
</td>
<td>
</td>
<td>
</td>
<td>
</td>
<td>login<sup id="cite_ref-bash_profiles_14-1" class="reference"><a href="#cite_note-bash_profiles-14"><span class="cite-bracket">[</span>note 7<span class="cite-bracket">]</span></a></sup>
</td>
<td>
</td></tr>
<tr>
<td style="text-align:left;"><tt>~/.bash_login</tt>
</td>
<td>
</td>
<td>
</td>
<td>
</td>
<td>
</td>
<td>login<sup id="cite_ref-bash_profiles_14-2" class="reference"><a href="#cite_note-bash_profiles-14"><span class="cite-bracket">[</span>note 7<span class="cite-bracket">]</span></a></sup>
</td>
<td>
</td></tr>
<tr>
<td style="text-align:left;"><tt>~/.bash_logout</tt>
</td>
<td>
</td>
<td>
</td>
<td>
</td>
<td>
</td>
<td>login
</td>
<td>
</td></tr>
<tr>
<td style="text-align:left;"><tt>~/.bashrc</tt>
</td>
<td>
</td>
<td>
</td>
<td>
</td>
<td>
</td>
<td>int.+n/login
</td>
<td>
</td></tr>
<tr>
<td style="text-align:left;"><tt>/etc/zshenv</tt>
</td>
<td>
</td>
<td>
</td>
<td>
</td>
<td>
</td>
<td>
</td>
<td>yes
</td></tr>
<tr>
<td style="text-align:left;"><tt>/etc/zprofile</tt>
</td>
<td>
</td>
<td>
</td>
<td>
</td>
<td>
</td>
<td>
</td>
<td>login
</td></tr>
<tr>
<td style="text-align:left;"><tt>/etc/zshrc</tt>
</td>
<td>
</td>
<td>
</td>
<td>
</td>
<td>
</td>
<td>
</td>
<td>int.
</td></tr>
<tr>
<td style="text-align:left;"><tt>/etc/zlogin</tt>
</td>
<td>
</td>
<td>
</td>
<td>
</td>
<td>
</td>
<td>
</td>
<td>login
</td></tr>
<tr>
<td style="text-align:left;"><tt>/etc/zlogout</tt>
</td>
<td>
</td>
<td>
</td>
<td>
</td>
<td>
</td>
<td>
</td>
<td>login
</td></tr>
<tr>
<td style="text-align:left;"><tt>~/.zshenv</tt>
</td>
<td>
</td>
<td>
</td>
<td>
</td>
<td>
</td>
<td>
</td>
<td>yes
</td></tr>
<tr>
<td style="text-align:left;"><tt>~/.zprofile</tt>
</td>
<td>
</td>
<td>
</td>
<td>
</td>
<td>
</td>
<td>
</td>
<td>login
</td></tr>
<tr>
<td style="text-align:left;"><tt>~/.zshrc</tt>
</td>
<td>
</td>
<td>
</td>
<td>
</td>
<td>
</td>
<td>
</td>
<td>int.
</td></tr>
<tr>
<td style="text-align:left;"><tt>~/.zlogin</tt>
</td>
<td>
</td>
<td>
</td>
<td>
</td>
<td>
</td>
<td>
</td>
<td>login
</td></tr></tbody></table>
<div class="clear" style="clear:both;"></div>
<div class="mw-heading mw-heading2"><h2 id="Analogie_chez_d'autres_systèmes_d'exploitation"><span id="Analogie_chez_d.27autres_syst.C3.A8mes_d.27exploitation"></span>Analogie chez d'autres systèmes d'exploitation</h2></div>

<p>Dans les différents systèmes d'exploitation <a href="Microsoft_Windows" title="Microsoft Windows">Microsoft Windows</a>, le programme analogue est <a href="Command.com" class="mw-redirect" title="Command.com">command.com</a>, ou <a href="Cmd.exe" class="mw-redirect" title="Cmd.exe">cmd.exe</a>.
</p>
<div class="mw-heading mw-heading2"><h2 id="Notes_et_références"><span id="Notes_et_r.C3.A9f.C3.A9rences"></span>Notes et références</h2></div>
<div class="mw-heading mw-heading3"><h3 id="Notes">Notes</h3></div>
<div class="references-small decimal" style=""><div class="mw-references-wrap"><ol class="references" data-mw-group="note">
<li id="cite_note-5"><span class="mw-cite-backlink"><a href="#cite_ref-5">↑</a> </span><span class="reference-text">only if <tt>~/.tcshrc</tt> not found</span>
</li>
<li id="cite_note-6"><span class="mw-cite-backlink"><a href="#cite_ref-6">↑</a> </span><span class="reference-text">Newer versions of the Bourne Shell only</span>
</li>
<li id="cite_note-9"><span class="mw-cite-backlink"><a href="#cite_ref-9">↑</a> </span><span class="reference-text">Available on systems that support the "User Portability Utilities option"; value of the variable must be an <i>absolute</i> path, and it is ignored "if the user's real and effective user IDs or real and effective group IDs are different."<sup id="cite_ref-8" class="reference"><a href="#cite_note-8"><span class="cite-bracket">[</span>6<span class="cite-bracket">]</span></a></sup></span>
</li>
<li id="cite_note-10"><span class="mw-cite-backlink"><a href="#cite_ref-10">↑</a> </span><span class="reference-text">$ENV is $HOME/.shrc in newer versions of the Bourne Shell</span>
</li>
<li id="cite_note-12"><span class="mw-cite-backlink"><a href="#cite_ref-12">↑</a> </span><span class="reference-text">Same behavior as <tt>sh</tt>, but only if invoked as <tt>sh</tt> (bash 2+) or, since bash 4.2, also if invoked <i>explicitly</i> in POSIX compatibility mode (with options <tt>--posix</tt> or <tt>-o posix</tt>)<sup id="cite_ref-11" class="reference"><a href="#cite_note-11"><span class="cite-bracket">[</span>7<span class="cite-bracket">]</span></a></sup>.</span>
</li>
<li id="cite_note-zsh_profiles-13"><span class="reference-text">Only in sh/ksh compatibility mode (when invoked as bash, sh, ksh)</span>
</li>
<li id="cite_note-bash_profiles-14"><span class="reference-text">in fact, the first readable of <tt>~/.bash_profile</tt>, <tt>~/.bash_login</tt> and <tt>~/.profile</tt>; and only <tt>~/.profile</tt> if invoked as <tt>sh</tt> or, as of at least Bash 4.2, if invoked <i>explicitly</i> in POSIX compatibility mode (with options <tt>--posix</tt> or <tt>-o posix</tt>)</span>
</li>
</ol></div>
</div>
<div class="mw-heading mw-heading3"><h3 id="Références"><span id="R.C3.A9f.C3.A9rences"></span>Références</h3></div>
<div class="references-small decimal" style=""><div class="mw-references-wrap"><ol class="references">
<li id="cite_note-:0-1"><span class="reference-text"><span class="ouvrage" id="Mezhoud"><span class="ouvrage" id="Karim_Mezhoud">Karim <span class="nom_auteur">Mezhoud</span>, «&nbsp;<a rel="nofollow" class="external text" href="https://wiki.ubuntu.com/kmezhoud/Bioinformatics?action=AttachFile&amp;do=get&amp;target=Shell-Regex.pdf"><cite style="font-style:normal;">Shell-Regex</cite></a>&nbsp;» <abbr class="abbr indicateur-format format-pdf" title="Document au format Portable Document Format (PDF) d'Adobe">[PDF]</abbr>, sur <span class="italique"><a rel="nofollow" class="external free" href="https://wiki.ubuntu.com">https://wiki.ubuntu.com</a></span></span></span></span>
</li>
<li id="cite_note-2"><span class="mw-cite-backlink"><a href="#cite_ref-2">↑</a> </span><span class="reference-text"><span class="ouvrage" id="MassonUniv_MLV"><span class="ouvrage" id="Damien_MassonUniv_MLV">Damien <span class="nom_auteur">Masson</span>, <a href="Universit%C3%A9_Paris-Est-Marne-la-Vall%C3%A9e" title="Université Paris-Est-Marne-la-Vallée">Univ MLV</a>, «&nbsp;<a rel="nofollow" class="external text" href="http://igm.univ-mlv.fr/~masson/Teaching/PIM-INF3/shell.pdf"><cite style="font-style:normal;">Le shell Principales commandes</cite></a>&nbsp;» <abbr class="abbr indicateur-format format-pdf" title="Document au format Portable Document Format (PDF) d'Adobe">[PDF]</abbr> (cours), sur <span class="italique"><a rel="nofollow" class="external free" href="http://igm.univ-mlv.fr">http://igm.univ-mlv.fr</a></span></span></span></span>
</li>
<li id="cite_note-3"><span class="mw-cite-backlink"><a href="#cite_ref-3">↑</a> </span><span class="reference-text"><span class="ouvrage">«&nbsp;<a rel="nofollow" class="external text" href="https://fr.linux-console.net/?p=17255"><cite style="font-style:normal;">Trouver le chemin d'une commande avec whereis</cite></a>&nbsp;», sur <span class="italique">fr.linux-console.net</span> <small style="line-height:1em;">(consulté le <time class="nowrap" datetime="2025-01-03" data-sort-value="2025-01-03">3 janvier 2025</time>)</small></span></span>
</li>
<li id="cite_note-4"><span class="mw-cite-backlink"><a href="#cite_ref-4">↑</a> </span><span class="reference-text"><span class="ouvrage">«&nbsp;<a rel="nofollow" class="external text" href="https://fr.linux-console.net/?p=14738"><cite style="font-style:normal;">Qu'est-ce que Tilde sous Linux</cite></a>&nbsp;», sur <span class="italique">fr.linux-console.net</span> <small style="line-height:1em;">(consulté le <time class="nowrap" datetime="2025-01-03" data-sort-value="2025-01-03">3 janvier 2025</time>)</small></span></span>
</li>
<li id="cite_note-7"><span class="mw-cite-backlink"><a href="#cite_ref-7">↑</a> </span><span class="reference-text">SCO Unix Group, <a rel="nofollow" class="external text" href="http://unix.harley.com/instructors/timeline.html">SCO Unixware 7 documentation, 22 Apr 2004, retrieved 18 Oct 2012</a>.</span>
</li>
<li id="cite_note-8"><span class="mw-cite-backlink"><a href="#cite_ref-8">↑</a> </span><span class="reference-text"><span class="ouvrage"><abbr class="abbr indicateur-langue" title="Langue : anglais">(en)</abbr> «&nbsp;<a rel="nofollow" class="external text" href="http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_05_03"><cite style="font-style:normal;" lang="en">Shell Command Language</cite></a>&nbsp;», <span class="italique">opengroup.org</span> <small style="line-height:1em;">(consulté le <time class="nowrap" datetime="2015-06-15" data-sort-value="2015-06-15">15 juin 2015</time>)</small></span></span>
</li>
<li id="cite_note-11"><span class="mw-cite-backlink"><a href="#cite_ref-11">↑</a> </span><span class="reference-text"><span class="ouvrage"><abbr class="abbr indicateur-langue" title="Langue : anglais">(en)</abbr> «&nbsp;<a rel="nofollow" class="external text" href="http://www.gnu.org/software/bash/manual/html_node/Bash-Startup-Files.html"><cite style="font-style:normal;" lang="en">Bash Reference Manual: Bash Startup Files</cite></a>&nbsp;», <span class="italique">gnu.org</span> <small style="line-height:1em;">(consulté le <time class="nowrap" datetime="2015-06-15" data-sort-value="2015-06-15">15 juin 2015</time>)</small></span></span>
</li>
</ol></div>
</div>
<ul><li><span class="ouvrage" id="Blackmore"><span class="ouvrage" id="Brian_Blackmore">Brian Blackmore, «&nbsp;<a rel="nofollow" class="external text" href="http://www.softlab.ntua.gr/facilities/documentation/unix/shelldiff.html"><cite style="font-style:normal;">UNIX shell differences</cite></a>&nbsp;» <small style="line-height:1em;">(consulté le <time class="nowrap" datetime="2012-02-13" data-sort-value="2012-02-13">13 février 2012</time>)</small></span></span></li></ul>
<div class="mw-heading mw-heading2"><h2 id="Voir_aussi">Voir aussi</h2></div>
<div class="mw-heading mw-heading3"><h3 id="Articles_connexes">Articles connexes</h3></div>
<ul><li><a href="Interpr%C3%A9teur_de_commandes" title="Interpréteur de commandes">Interpréteur de commandes</a></li>
<li><a href="Commandes_Unix" title="Commandes Unix">Commandes Unix</a></li>
<li><a href="Shell_(informatique)" class="mw-redirect" title="Shell (informatique)">Shell (informatique)</a></li>
<li><a href="Reverse_shell" title="Reverse shell">Reverse shell</a></li></ul>
<div class="navbox-container" style="clear:both;">


</div>
<ul id="bandeau-portail" class="bandeau-portail"><li><span class="bandeau-portail-element"><span class="bandeau-portail-icone"><span class="noviewer" typeof="mw:File"></span></span> <span class="bandeau-portail-texte">Portail de l’informatique</span> </span></li> <li><span class="bandeau-portail-element"><span class="bandeau-portail-icone"><span class="noviewer" typeof="mw:File"></span></span> <span class="bandeau-portail-texte">Portail de la programmation informatique</span> </span></li> </ul></div><!--htdig_noindex--><div><div class="zim-footer">
Cet article est issu de <a class="external text" title="Dernière modification le 2025-10-04" href="https://fr.wikipedia.org/wiki/?title=Shell_Unix&amp;oldid=229494778">Wikipédia</a>. Sauf mention contraire, le texte est disponible sous <a class="external text" href="https://creativecommons.org/licenses/by-sa/4.0/deed.fr">Creative Commons Attribution-Share Alike 4.0</a>. Des conditions supplémentaires peuvent s’appliquer aux fichiers multimédias.
</div>
</div><!--/htdig_noindex--></div>
</div>
</main>
</div>
</div>
</div>
<script src="./_webp_/webpHandler.js"></script>

</body></html>